/* -----------------------------------------------------------------------
 * Chris Lewis
 * CS 362
 * Assignment 3: cardtest1.c to test feast card
 *
 * cardtest3: cardtest3.c dominion.o rngs.o
 *      gcc -o cardtest3 -g  cardtest3.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define DEBUG 0
#define NOISY_TEST 1

int main () {

  int r;
  int seed = 1000;
  int numPlayer = 2;
  int k[10] = {adventurer, council_room, feast, gardens, mine,
               remodel, smithy, village, baron, great_hall};
  int bonus = 0;
  struct gameState G;
  int s;
  
  r = initializeGame(numPlayer, k, seed, &G);

  int coins = G.coins;

  puts("\n\n********* TESTING FEAST ************\n");

#if (NOISY_TEST == 1)
  printf ("initializeGame(%d, k, %d, &G) = %d\n", numPlayer, seed, r);
#endif

  assert(r == 0);

#if (NOISY_TEST == 1)
  printf ("Beginning # of coins: %d\n", G.coins);
#endif

  puts("playing feast");
  s = cardEffect(feast,0,0,0,&G,1,&bonus);
  assert(s == 0);
  

  assert( G.coins = coins + 4);     //This is here so that it will run with the bug in place (line 699 of dominion.c)
  //assert( G.coins = coins + 5);   //This is the correct line if the bug weren't present

#if (NOISY_TEST == 1)
  printf ("Ending # of coins: %d\n", G.coins);
#endif

  printf("feast card: PASS\n");

  return 0;
}